<?php
	require_once(dirname(__FILE__)."/../core/safeParam.php");
	
	class admin{
		function UpdateConfig($vars){
			global $database;
    		$id          = $vars['id'];
    		$siteroot    = $vars['siteroot'];
    		$sitename    = $vars['sitename'];
    		$username    = $vars['username'];
    		$password    = $vars['password'];
    		
    		if ($password){
    			$password = md5($password);
    		}
    		
    		$email       = $vars['email'];
    		$description = $vars['description'];
    		$keywords    = $vars['keywords'];
    		$address     = $vars['address'];
    		$address2    = $vars['address2'];
    		$city        = $vars['city'];
    		$state       = $vars['state'];
    		$phone       = $vars['phone'];
    		$fax         = $vars['fax'];
    		$layout      = $vars['layout'];
    		$theme       = $vars['theme'];
    		$email1      = $vars['email1'];
    		$email2      = $vars['email2'];
    		$email3      = $vars['email3'];
    		$email4      = $vars['email4'];
    		$email5      = $vars['email5'];
    		$email6      = $vars['email6'];
    		$query       = $database->update("config", "siteroot = '$siteroot', sitename = '$sitename', username = '$username', password = '$password', email = '$email',
       													description = '$description', keywords = '$keywords', address = '$address', address2 = '$address2', city = '$city', 
       													state = '$state', phone = '$phone', fax = '$fax', layout = '$layout', theme = '$theme', email1 = '$email1', email2 = '$email2',
      													email3 = '$email3', email4 = '$email4', email5 = '$email5', email6 = '$email6'", "id = '1'");
    		
    		
    		header('location: ../administrator/admin.php?page=config&updated=1');
	  	}
	}
?>
